package org.dbwebx.flex.module.bundle.views
{

	import flash.events.Event;
	
	import mx.collections.ArrayCollection;
	import mx.containers.VBox;
	
	import org.dbwebx.flex.delegate.impl.BundleService;
	import org.fxcontainer.controls.ext.FxGrid;

	public class BundleListBase extends VBox
	{
		public function BundleListBase()
		{
			super();
		}

		/**
		 * Reference to <code>FxGrid</code>
		 * @default
		 */
		public var bundleList:FxGrid;

		[Bindable]
		[Autowire(bean="BundleService")]
		public var bundleService:BundleService;

		[Mediate(event="bundleListLoaded",properties="bundles")]
		public function bundleListReceiver(list:ArrayCollection):void
		{
			if (null != list)
			{
				bundleList.dataProvider=list;
			}
		}

		/**
		 * Preloads bundles.
		 * @param event
		 */
		protected function showHandler(event:Event):void
		{	
			bundleService.list(["bundleListLoaded"]);
		}

	}
}